﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Web;

/// <summary>
/// Class1 的摘要描述
/// </summary>

[System.ComponentModel.DataObjectAttribute(true)]
public partial class BLL_ManageRole
{
    public BLL_ManageRole()
    {
        //
        // TODO: 在此加入建構函式的程式碼
        //
    }

    //SELECT 所有角色 (新增角色作業的繼承角色)
    [System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select)]
    public DataTable BLL_SelectAllRoles()
    {
        clsDBUtility dbUtil = clsDBUtility.GetInstance();
        return dbUtil.SelectAllRoles();
    }


    //SELECT
    [System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select)]
    public DataTable BLL_Select(string PapaID, string Parent)
    {
        clsDBUtility dbUtil = clsDBUtility.GetInstance();
        return dbUtil.ManageRole_Select(PapaID);
    }

    //Insert
    [System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Insert)]
    public int BLL_Insert(int Parent, string RoleName, string RoleDescription)
    {
        clsDBUtility dbUtil = clsDBUtility.GetInstance();
        return dbUtil.ManageRole_Insert(Parent, RoleName, RoleDescription);
    }

    //Update
    [System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Update)]
    public int BLL_Update(int original_RoleID, string RoleName, string RoleDescription, string Active)
    {
        clsDBUtility dbUtil = clsDBUtility.GetInstance();
        return dbUtil.ManageRole_Update(original_RoleID, RoleName, RoleDescription, Active);
    }

    //Delete
    [System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Delete)]
    public int BLL_Delete(int original_RoleID)
    {
        clsDBUtility dbUtil = clsDBUtility.GetInstance();
        return dbUtil.ManageRole_Delete(original_RoleID);
    }

}
